module page {

    export class RelivePage extends egret.DisplayObjectContainer {

        public static readonly Comform:string = "relive_confirm";
        public static readonly Refuse:string = "refuse_confirm";

        private bgImg: egret.Bitmap;

        private confirmBtn: ui.PushButton;

        private refuseBtn: ui.PushButton;

        public constructor() {
            super();

            this.bgImg = manager.ResManager.getBitmap("relive_bg");
            this.addChild(this.bgImg);

            this.confirmBtn = new ui.PushButton(manager.ResManager.getBitmap("fdverre_png"));
            this.addChild(this.confirmBtn);

            this.refuseBtn = new ui.PushButton(manager.ResManager.getBitmap("u6ut_png"));
            this.addChild(this.refuseBtn);

            this.confirmBtn.y = this.bgImg.height - this.confirmBtn.height / 2;

            this.refuseBtn.y = this.bgImg.height - this.refuseBtn.height / 2;

            this.refuseBtn.x = 50;

            this.confirmBtn.x =  this.bgImg.width - this.confirmBtn.width - 50;

            this.refuseBtn.addEventListener(ui.PushButton.CLICK, this.onRefuse, this);
            this.confirmBtn.addEventListener(ui.PushButton.CLICK, this.onComfirm, this);
        }


        private onRefuse(eve:egret.Event):void {
            this.dispatchEvent(new egret.Event(RelivePage.Refuse));
        }

        private onComfirm(eve:egret.Event):void {
            this.dispatchEvent(new egret.Event(RelivePage.Comform));
        }

    }

}